-
-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[LiveComponent] (Dynamic Form) Do not clear missing values on submit #2397
base: 2.x
Are you sure you want to change the base?
Conversation
…values on submit
Thank you for this PR @momocode-de! I took time to look at it and one question arises: does this only change solves your DynamicFormBundle problem ? Or is this only a step ? Right now i'm a bit hesitant here... if i(m not reading this badly, it would be a strong behaviour change:
https://symfony.com/doc/current/form/direct_submit.html At least we would need some tests here, and a clear explanation of what would happen in the different scenario with some honest before/after. Right now (and i'm very open to change my position)... i don't know... maybe you should first try to change this on your side? Because i'm not sure we should take this risk.. What do you think ? |
Hi @momocode-de, does this really resolve the issue? I've come across this problem myself and tried locally your changes and unfortunately this solve didn't work for me. I understand we both have different environments, but this simple code snippet is still affected. Could you please provide an example of code that was fixed by your change? Maybe there were more steps to resolve the issue which I don't see.
|
I just opened SymfonyCasts/dynamic-forms#43, which is related here. I can confirm, that |
Well, then .. do you guys think we could add some test here showing maybe the before/after ? Also @momocode-de if you could rebase ? After that,LGTM! (let's also check/test as much possible in real conditions on the |
If you have a LiveComponent for a form with dependent fields which have been implemented with the dynamic-forms bundle, it can happen that the pre-defined value disappears for fields that are displayed later. This is due to the
$clearMissing
parameter of theSymfony\Component\Form::submit
function. This parameter istrue
by default and therefore I now set it to “false” so that the values are not cleared.I can't assess whether this would have unwanted side effects. Please check it out and if you think it fits, you can merge it.